package com.linwancun.lwcyback.service;

import com.linwancun.lwcyback.mapper.HospitalMapper;
import com.linwancun.lwcyback.model.Hospital;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class HospitalServiceImpl implements HospitalService {
    @Resource
    private HospitalMapper hospitalMapper;

    @Override
    public void insert(Hospital object) {
        hospitalMapper.insert(object);
    }

    @Override
    public void save(Hospital object) {
        hospitalMapper.updateByPrimaryKey(object);
    }

    @Override
    public List<Hospital> getAll() {
        return hospitalMapper.list(new Hospital());
    }

    @Override
    public Hospital find(Hospital object) {
        return hospitalMapper.find(object);
    }

    @Override
    public void delete(Hospital object) {
        hospitalMapper.deleteByPrimaryKey(object.getHospitalid());
    }

    @Override
    public List<Hospital> getList(Hospital object) {
        return hospitalMapper.list(object);
    }
}
